package com.ruoyi.web.controller.system;

import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.VApplicationInfoScore;
import com.ruoyi.system.service.IVApplicationInfoScoreService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 考生信息查询Controller
 * 
 * @author ruoyi
 * @date 2024-12-14
 */
@Controller
@RequestMapping("/system/VApplicationInfoScore")
public class VApplicationInfoScoreController extends BaseController
{
    private String prefix = "system/VApplicationInfoScore";

    @Autowired
    private IVApplicationInfoScoreService vApplicationInfoScoreService;

    @RequiresPermissions("system:VApplicationInfoScore:view")
    @GetMapping()
    public String VApplicationInfoScore()
    {
        return prefix + "/VApplicationInfoScore";
    }

    /**
     * 查询考生信息查询列表
     */
    @RequiresPermissions("system:VApplicationInfoScore:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(VApplicationInfoScore vApplicationInfoScore)
    {
        startPage();
        List<VApplicationInfoScore> list = vApplicationInfoScoreService.selectVApplicationInfoScoreList(vApplicationInfoScore);
        return getDataTable(list);
    }

    /**
     * 导出考生信息查询列表
     */
    @RequiresPermissions("system:VApplicationInfoScore:export")
    @Log(title = "考生信息查询", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    @ResponseBody
    public AjaxResult export(VApplicationInfoScore vApplicationInfoScore)
    {
        List<VApplicationInfoScore> list = vApplicationInfoScoreService.selectVApplicationInfoScoreList(vApplicationInfoScore);
        ExcelUtil<VApplicationInfoScore> util = new ExcelUtil<VApplicationInfoScore>(VApplicationInfoScore.class);
        return util.exportExcel(list, "考生信息查询数据");
    }

    /**
     * 新增考生信息查询
     */
    @GetMapping("/add")
    public String add()
    {
        return prefix + "/add";
    }

    /**
     * 新增保存考生信息查询
     */
    @RequiresPermissions("system:VApplicationInfoScore:add")
    @Log(title = "考生信息查询", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    @ResponseBody
    public AjaxResult addSave(VApplicationInfoScore vApplicationInfoScore)
    {
        return toAjax(vApplicationInfoScoreService.insertVApplicationInfoScore(vApplicationInfoScore));
    }

    /**
     * 修改考生信息查询
     */
    @RequiresPermissions("system:VApplicationInfoScore:edit")
    @GetMapping("/edit/{applicationId}")
    public String edit(@PathVariable("applicationId") Long applicationId, ModelMap mmap)
    {
        VApplicationInfoScore vApplicationInfoScore = vApplicationInfoScoreService.selectVApplicationInfoScoreByApplicationId(applicationId);
        mmap.put("vApplicationInfoScore", vApplicationInfoScore);
        return prefix + "/edit";
    }

    /**
     * 修改保存考生信息查询
     */
    @RequiresPermissions("system:VApplicationInfoScore:edit")
    @Log(title = "考生信息查询", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    @ResponseBody
    public AjaxResult editSave(VApplicationInfoScore vApplicationInfoScore)
    {
        return toAjax(vApplicationInfoScoreService.updateVApplicationInfoScore(vApplicationInfoScore));
    }

    /**
     * 删除考生信息查询
     */
    @RequiresPermissions("system:VApplicationInfoScore:remove")
    @Log(title = "考生信息查询", businessType = BusinessType.DELETE)
    @PostMapping( "/remove")
    @ResponseBody
    public AjaxResult remove(String ids)
    {
        return toAjax(vApplicationInfoScoreService.deleteVApplicationInfoScoreByApplicationIds(ids));
    }
}
